package com.jtapps.remall;

import android.app.Activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class TaskActivity extends Activity {
	
	  /*Menu variables opening */
    private final static int ADD_ITEM = 1;
    private final static int SORT_ITEM = 2;
    private final static int PREFERENCES_ITEM = 3;
    /*Menu variables ending*/
    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.task_layout);
    }
    
    /*Menu structure opening */
    public boolean onCreateOptionsMenu (Menu menu) {
        menu.add(1,ADD_ITEM,1,"Neu").setIcon(R.drawable.ic_menu_add);
        menu.add(2,SORT_ITEM,2,"Sortieren").setIcon(R.drawable.ic_menu_sort_by_size);
        menu.add(3,PREFERENCES_ITEM,3,"Optionen").setIcon(R.drawable.ic_menu_preferences);



        return true ;
    }

    public boolean onOptionsItemSelected (MenuItem item){
    	Intent intent=null;
        switch (item.getItemId()){
        
            case ADD_ITEM:
            	Use.onTab("TASK");
            	intent=new Intent();
            	intent.setClass(this, NewActivity_Tasks.class);
            	startActivity(intent);
                return true;
            case SORT_ITEM :
                return true;
            case PREFERENCES_ITEM :
            	//Open Option Activity (Intent)
            	intent=new Intent();
              	intent.setClass(this, OptionActivity.class);
            	startActivity(intent);
                return true;
        }
        return false;
    }

    /*Menu structure ending */
}
